﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucAddCategories.ascx.cs"
    Inherits="Admin_UserControl_ucAddCategories" %>
<div id="center-column">
    <h1>
        Danh Mục Loại Sản Phẩm</h1>
    <br />
    <div>
        <asp:HyperLink ID="hyp" runat="server" NavigateUrl="~/Admin/DanhSachSanPham.aspx" Font-Size="Medium">Quay lại</asp:HyperLink>
    </div>
    <br />
    <table class="style2">
        <tr>
            <td valign="top">
                <asp:Panel ID="Panel1" runat="server">
                    <table style="width: 100%">
                        <tr>
                            <th>
                                Tên loại sản phẩm :
                            </th>
                            <td>
                                <asp:TextBox ID="txtCateName" runat="server" Width="170px"></asp:TextBox>
                                &nbsp;<asp:RequiredFieldValidator ID="reqCatename" runat="server" ControlToValidate="txtCateName"
                                    Text="*" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator><asp:Label
                                        ID="lb_message" runat="server" ForeColor="Red"></asp:Label></td>
                        </tr>
                        <tr>
                            <th>
                                Mô tả loại sản phẩm :
                            </th>
                            <td>
                                <asp:TextBox ID="txtCateDes" runat="server" TextMode="MultiLine" Width="170px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rqDescription" runat="server" ControlToValidate="txtCateDes"
                                    Text="*" Font-Bold="True"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                Nhóm sản phẩm
                            </th>
                            <td>
                                <asp:DropDownList ID="drgroup" runat="server">
                                    <asp:ListItem Value="1" Text="iPhone-iPad-iPod"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Macbook-Mac mini-iMac"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="Phụ kiện iPhone"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="Phụ kiện iPad"></asp:ListItem>
                                    <asp:ListItem Value="5" Text="Phụ kiện iPod"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <th>
                             <asp:Label ID="lb" runat="server" Text="Hình ảnh :" Visible ="false"></asp:Label>
                            </th>
                            <td>
                                <asp:FileUpload ID="upload" runat="server" Width="260px" Visible="false" />
                            </td>
                        </tr>
                        <tr>
                            <th>
                                &nbsp;
                            </th>
                            <td>
                                <asp:Label ID="lbmesage" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                &nbsp;</th>
                            <td>
                                <asp:Button ID="btAdd" runat="server" OnClick="btAdd_Click" Text="Save" />
                            </td>
                        </tr>
                        <tr>
                            <th colspan="2">
                                <asp:GridView ID="grdCate" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                                    CellPadding="3" PageSize="4" ShowFooter="True" Width="650px" 
                                    Style="text-align: center" onpageindexchanging="grdCate_PageIndexChanging">
                                    <RowStyle ForeColor="#000066" />
                                    <FooterStyle BackColor="White" ForeColor="#000066" />
                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="STT">
                                            <ControlStyle Height="22px" />
                                            <ItemStyle HorizontalAlign="Center" Width="20px" />
                                            <ItemTemplate>
                                                <asp:Label ID="STT" runat="server" Text="<%# ((grdCate.PageIndex * grdCate.PageSize) + grdCate.Rows.Count + 1)%>" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <%--   <asp:BoundField DataField="CateName" HeaderText="CategoryName" SortExpression="CateName">
                                          <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                         </asp:BoundField>--%>
                                        <asp:HyperLinkField DataNavigateUrlFields="CateID" DataNavigateUrlFormatString="~/Admin/LoaiSanPham.aspx?id={0}"
                                            DataTextField="CateName" HeaderText="Tên loại sản phẩm" SortExpression="CateName">
                                            <ItemStyle Width="150px" />
                                        </asp:HyperLinkField>
                                        <asp:BoundField DataField="CateDescription" HeaderText="Mô tả loại sản phẩm " SortExpression="CateDescription" />
                                        <asp:ImageField DataImageUrlField="ImageURL" DataImageUrlFormatString="~/Admin/images/Items/{0}"
                                            HeaderText="Hình ảnh">
                                            <ControlStyle Height="80px" Width="100px" />
                                        </asp:ImageField>
                                    </Columns>
                                </asp:GridView>
                            </th>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
</div>
